var apiwriter = require('apiwriter');

exports.getContext = function() {
    return {
        createdId: null
    };
};

exports.submitRequests = function()
{
    apiwriter.postJson('/discussions', {"title":"A discussion", "author":"me"},
        function(context, result) {
            context.createdId = result.responseBody.id;
        });

    apiwriter.postJson('/discussions', {"title":"Another discussion", "author":"me"});
    apiwriter.getJson('/discussions');
    apiwriter.getJson('/discussions/{createdId}');
    apiwriter.deleteJson('/discussions/{createdId}');
}

